package com.bjpowernode.controller;
import com.bjpowernode.dto.ResultDTO;
import com.bjpowernode.exception.MyDateExceptionAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

@RestControllerAdvice
public class MyDateControllerAdvice {
    @ExceptionHandler(MyDateExceptionAdvice.class)
    public ResultDTO get(MyDateExceptionAdvice e){
        ResultDTO resultDTO=new ResultDTO();
        resultDTO.setResult(ResultDTO.ERROR);
        resultDTO.setError(e.getMessage());
        return resultDTO;
    }
}
